package l1j.server.server.command.executor;

import java.util.StringTokenizer;

import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.model.skill.L1BuffUtil;
import l1j.server.server.serverpackets.S_SystemMessage;

public class L1Speed implements L1CommandExecutor {
	public static L1CommandExecutor getInstance() {
		return new L1Speed();
	}

	private L1Speed() {
	}

	@Override
	public void execute(final L1PcInstance pc, final String cmdName, final String arg) {
		try {
			final StringTokenizer st = new StringTokenizer(arg);
			byte type=1;

			if(st.hasMoreTokens()){
				type = Byte.parseByte(st.nextToken());
				}
		//	L1BuffUtil.haste(pc, 3600 * 1000);
			//TODO 3段加速
			L1BuffUtil.supperSpeed(pc, 3600000 , type);
			//TODO 3段加速
		} catch (final Exception e) {
			pc.sendPackets(new S_SystemMessage(".speed 指令錯誤！"));
		}
	}
}
